<!-- Left logo -->
<?php
if (session('manageInfo')['account_id'] == 1) {
?>
<aside class="main-sidebar">
    <section class="sidebar">
        <!-- 导航页面 -->
        <ul class="sidebar-menu">
            <li class="treeview <if condition='CONTROLLER_NAME eq index'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-dashboard"></i> <span>首页管理</span>
                    <span class="pull-right-container">
                      <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="active"><a href="{:U('manage/index/index')}"><i class="fa fa-circle-o"></i> 首页</a></li>
                </ul>
            </li>
            <li class="<?php echo  CONTROLLER_NAME == 'Weixin'  ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i>
                    <span>微信设置</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq twoDBarcode'>active</if>"><a href="{:U('Weixin/twoDBarcode')}"><i class="fa fa-circle-o"></i> 二维码列表</a></li>
                </ul>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq wxInformation'>active</if>">
                        <a href="{:U('Weixin/wxInformation')}"><i class="fa fa-circle-o"></i> 微信消息模板列表</a>
                    </li>
                </ul>
            </li>
            <li class="<?php echo  CONTROLLER_NAME == 'Letter'  ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>短信管理</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('Letter/index')}"><i class="fa fa-circle-o"></i> 短信模板</a></li>
                </ul>
            </li>

            <li class="treeview <if condition='CONTROLLER_NAME eq Purchase'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i>
                    <span>采购</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('purchase/index')}"><i class="fa fa-circle-o"></i> 采购单列表</a></li>
                    <li class="<if condition='ACTION_NAME eq setup'>active</if>"><a href="{:U('purchase/setup')}"><i class="fa fa-circle-o"></i> 可采购商品配置</a></li>
                    <li class="<if condition='ACTION_NAME eq stores or ACTION_NAME eq store_setup'>active</if>"><a href="{:U('purchase/stores')}"><i class="fa fa-circle-o"></i> 店铺可采购商品配置</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Vendor'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>供应商</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('manage/vendor/index')}"><i class="fa fa-circle-o"></i>供应商档案</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Goods or CONTROLLER_NAME eq GoodsCat'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-laptop"></i>
                    <span>商品</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="{:U('manage/GoodsCat/index')}"><i class="fa fa-circle-o"></i> 总分类</a></li>
                    <li><a href="{:U('manage/Goods/index')}" ><i class="fa fa-circle-o"></i> 基础商品库</a></li>
                </ul>
            </li>
            <li class="treeview">
                <a href="javascript:;">
                    <i class="fa fa-edit"></i> <span>订单</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu <if condition='CONTROLLER_NAME eq Orders'>active</if>">
                    <li><a href="{:U('Orders/orderList')}"><i class="fa fa-circle-o"></i> 所有订单</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Special'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-table"></i> <span>营销</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="{:U('special/index')}"><i class="fa fa-circle-o"></i> 专题模板</a></li>
                    <li><a href="{:U('Feedback/index')}"><i class="fa fa-circle-o"></i> 投诉与建议</a></li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    <i class="fa fa-calendar"></i> <span>统计</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>                
                </a>
                <ul class="treeview-menu">
                    <li><a href=""><i class="fa fa-circle-o"></i> 销售统计</a></li>
                    <li><a href=""><i class="fa fa-circle-o"></i> 会员统计</a></li>
                    <li><a href=""><i class="fa fa-circle-o"></i> 订单统计</a></li>
                </ul>
            </li>
            <li class="<?php echo CONTROLLER_NAME == 'Rbac' ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-envelope"></i> <span>权限</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="/manage/rbac/user"><i class="fa fa-circle-o"></i> 帐户</a></li>
                    <li><a href="/manage/rbac/role"><i class="fa fa-circle-o"></i> 角色</a></li>
                    <li><a href="/manage/rbac/menu"><i class="fa fa-circle-o"></i> 菜单</a></li>
                </ul>
            </li>
            <li class="treeview <?php echo (CONTROLLER_NAME == 'Store' or CONTROLLER_NAME == 'Dly') ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-folder"></i> <span>店铺</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="/manage/store/index"><i class="fa fa-circle-o"></i> 店铺管理</a></li>
                    <li><a href="/manage/store/shelves"><i class="fa fa-circle-o"></i> 可上架商品管理</a></li>
                    <li><a href="/manage/Dly/index"><i class="fa fa-circle-o"></i> 店铺物流公司</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Refund or CONTROLLER_NAME eq Feedback'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>售后</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('Refund/index',array('view'=>1))}"><i class="fa fa-circle-o"></i> 退款退货</a></li>
                    <li class=""><a href=""><i class="fa fa-circle-o"></i> 投诉</a></li>
                </ul>
            </li>
            <li class="treeview">
                <a href="{:U('User/index')}">
                    <i class="fa fa-share"></i> <span>会员</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="{:U('User/index')}"><i class="fa fa-circle-o"></i> 会员列表</a></li>
                    <li><a href="{:U('User/tempUser')}"><i class="fa fa-circle-o"></i> 游客列表</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Bonus'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i>
                    <span>奖金</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('Bonus/index')}"><i class="fa fa-circle-o"></i>奖金流水列表</a></li>
                </ul>
            </li>
            <li class="header">财务</li>
            <li><a href="{:U('Bills/index')}"><i class="fa fa-circle-o text-red"></i> <span>店铺结算账单</span></a></li>
            <!--<li><a href="#"><i class="fa fa-circle-o text-yellow"></i> <span>备注2</span></a></li>
            <li><a href="#"><i class="fa fa-circle-o text-aqua"></i> <span>备注3</span></a></li>-->


        </ul>
    </section>
    <!-- /.sidebar -->
</aside>

<?php
}else{

?>

<aside class="main-sidebar">
    <section class="sidebar">
        <!-- 导航页面 -->
        <ul class="sidebar-menu">

            <?php
    foreach ($nav_menu as $k=>$v) {
            switch ($k)
            {
            case 0:
            $iClass = 'fa-dashboard';
            break;
            case 1:
            $iClass = 'fa-th';
            break;
            case 2:
            $iClass = 'fa-laptop';
            break;
            case 3:
            $iClass = 'fa-edit';
            break;
            case 4:
            $iClass = 'fa-table';
            break;
            case 5:
            $iClass = 'fa-folder';
            break;
            default:
            $iClass = 'fa-dashboard';
            }

            ?>
            <li class="treeview">
                <a href="#">
                    <i class="fa <?php echo $iClass; ?>"></i> <span><?php echo $v['name'];?></span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <?php
                    foreach ($menu as $value) {
                        if($v['id'] == $value['nav_menu_id']) {
                    ?>
                    <li><a href="<?php echo $value['value']; ?>"><i class="fa fa-circle-o"></i> <?php echo $value['name']?></a></li>
                    <?php }} ?>
                </ul>
            </li>
            <?php }  ?>
        </ul>
         <script type="text/javascript">
			var curHref = window.location.href.toLowerCase();
			$(".sidebar-menu .treeview-menu a").each(function(){
				if(curHref.indexOf($(this).attr("href").toLowerCase()) != -1){
					$(this).parents(".treeview").addClass("active");
					$(this).parent().addClass("active");
				}	
			});
		</script>
    </section>
    <!-- /.sidebar -->
</aside>
<?php } ?>